home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / python2.6 / hotshot / stones.pyc (.txt) < prev   
Python Compiled Bytecode  |  2009-11-11  |  1KB  |  36 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import errno
  5. import hotshot
  6. import hotshot.stats as hotshot
  7. import sys
  8. import test.pystone as test
  9.  
  10. def main(logfile):
  11.     p = hotshot.Profile(logfile)
  12.     (benchtime, stones) = p.runcall(test.pystone.pystones)
  13.     p.close()
  14.     print 'Pystone(%s) time for %d passes = %g' % (test.pystone.__version__, test.pystone.LOOPS, benchtime)
  15.     print 'This machine benchmarks at %g pystones/second' % stones
  16.     stats = hotshot.stats.load(logfile)
  17.     stats.strip_dirs()
  18.     stats.sort_stats('time', 'calls')
  19.     
  20.     try:
  21.         stats.print_stats(20)
  22.     except IOError:
  23.         e = None
  24.         if e.errno != errno.EPIPE:
  25.             raise 
  26.         e.errno != errno.EPIPE
  27.  
  28.  
  29. if __name__ == '__main__':
  30.     if sys.argv[1:]:
  31.         main(sys.argv[1])
  32.     else:
  33.         import tempfile
  34.         main(tempfile.NamedTemporaryFile().name)
  35.  
  36.